Optimal. Leaf size=160 \[ \frac {\left (a^2 (3-n)-b^2 (1+n)\right ) \, _2F_1\left (2,\frac {1+n}{2};\frac {3+n}{2};\sin ^2(c+d x)\right ) \sin ^{1+n}(c+d x)}{4 d (1+n)}+\frac {a b (2-n) \, _2F_1\left (2,\frac {2+n}{2};\frac {4+n}{2};\sin ^2(c+d x)\right ) \sin ^{2+n}(c+d x)}{2 d (2+n)}+\frac {\sec ^4(c+d x) \sin ^{1+n}(c+d x) \left (a^2+b^2+2 a b \sin (c+d x)\right )}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.17, antiderivative size = 160, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {2916, 1820,
822, 371} \begin {gather*} \frac {\left (a^2 (3-n)-b^2 (n+1)\right ) \sin ^{n+1}(c+d x) \, _2F_1\left (2,\frac {n+1}{2};\frac {n+3}{2};\sin ^2(c+d x)\right )}{4 d (n+1)}+\frac {\sec ^4(c+d x) \sin ^{n+1}(c+d x) \left (a^2+2 a b \sin (c+d x)+b^2\right )}{4 d}+\frac {a b (2-n) \sin ^{n+2}(c+d x) \, _2F_1\left (2,\frac {n+2}{2};\frac {n+4}{2};\sin ^2(c+d x)\right )}{2 d (n+2)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 371
Rule 822
Rule 1820
Rule 2916
Rubi steps
\begin {align*} \int \sec ^5(c+d x) \sin ^n(c+d x) (a+b \sin (c+d x))^2 \, dx &=\frac {b^5 \text {Subst}\left (\int \frac {\left (\frac {x}{b}\right )^n (a+x)^2}{\left (b^2-x^2\right )^3} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {\sec ^4(c+d x) \sin ^{1+n}(c+d x) \left (a^2+b^2+2 a b \sin (c+d x)\right )}{4 d}-\frac {b^3 \text {Subst}\left (\int \frac {\left (\frac {x}{b}\right )^n \left (-a^2 (3-n)+b^2 (1+n)-2 a (2-n) x\right )}{\left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{4 d}\\ &=\frac {\sec ^4(c+d x) \sin ^{1+n}(c+d x) \left (a^2+b^2+2 a b \sin (c+d x)\right )}{4 d}+\frac {\left (a b^4 (2-n)\right ) \text {Subst}\left (\int \frac {\left (\frac {x}{b}\right )^{1+n}}{\left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{2 d}+\frac {\left (b^3 \left (a^2 (3-n)-b^2 (1+n)\right )\right ) \text {Subst}\left (\int \frac {\left (\frac {x}{b}\right )^n}{\left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{4 d}\\ &=\frac {\left (a^2 (3-n)-b^2 (1+n)\right ) \, _2F_1\left (2,\frac {1+n}{2};\frac {3+n}{2};\sin ^2(c+d x)\right ) \sin ^{1+n}(c+d x)}{4 d (1+n)}+\frac {a b (2-n) \, _2F_1\left (2,\frac {2+n}{2};\frac {4+n}{2};\sin ^2(c+d x)\right ) \sin ^{2+n}(c+d x)}{2 d (2+n)}+\frac {\sec ^4(c+d x) \sin ^{1+n}(c+d x) \left (a^2+b^2+2 a b \sin (c+d x)\right )}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.15, size = 158, normalized size = 0.99 \begin {gather*} \frac {\left (2 \left (3 a^2-b^2\right ) \, _2F_1\left (1,\frac {1+n}{2};\frac {3+n}{2};\sin ^2(c+d x)\right )+(a-b) (3 a+b) \, _2F_1(2,1+n;2+n;-\sin (c+d x))+(3 a-b) (a+b) \, _2F_1(2,1+n;2+n;\sin (c+d x))+2 (a-b)^2 \, _2F_1(3,1+n;2+n;-\sin (c+d x))+2 (a+b)^2 \, _2F_1(3,1+n;2+n;\sin (c+d x))\right ) \sin ^{1+n}(c+d x)}{16 d (1+n)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.63, size = 0, normalized size = 0.00 \[\int \left (\sec ^{5}\left (d x +c \right )\right ) \left (\sin ^{n}\left (d x +c \right )\right ) \left (a +b \sin \left (d x +c \right )\right )^{2}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\sin \left (c+d\,x\right )}^n\,{\left (a+b\,\sin \left (c+d\,x\right )\right )}^2}{{\cos \left (c+d\,x\right )}^5} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________